package com.azdebugit.map.test;

class MyclassOther implements Comparable<MyclassOther> {
    public int x;

    public String name;

    public MyclassOther(int x, String name) {
        this.x = x;
        this.name = name;

    }

    @Override
    public String toString() {
        return x + " " + name;
    }

    public int getX() {
        return x;
    }

    public String getName() {
        return name;
    }

    @Override
    public int compareTo(MyclassOther o) {
        if (this.x == o.x) {
            return this.name.compareTo(o.name);
        } else {
            return this.x - o.x;
        }
    }
}